package com.ls.lserp.modules.common.service;

import com.ls.lserp.common.persistence.Page;
import com.ls.lserp.common.service.CrudService;
import com.ls.lserp.modules.common.Dao.CommonMaterialListDao;
import com.ls.lserp.modules.common.entity.CommonMaterialList;
import com.ls.lserp.modules.common.entity.OgnizationEntity;
import com.ls.lserp.modules.sys.entity.Brand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: CommonMaterialListService
 * @Description: 原辅料一览共同画面
 * 
 * @author 于辉
 * @date 2017年04月18日
 * 
 */
@Service
@Transactional(readOnly = false)
public class CommonMaterialListService extends CrudService<CommonMaterialListDao, CommonMaterialList> {
	@Autowired
	private CommonMaterialListDao commonMaterialListDao;

	/**
	 * @Title: 原辅料共同画面一览
	 */
	/**
	 * @Title: findList
	 * @Description: 一览查询
	 * @param commonMaterialList
	 * @return Page<CommonMaterialList>
	 */
	public Page<CommonMaterialList> selectfindList(Page<CommonMaterialList> page,CommonMaterialList commonMaterialList) {
		commonMaterialList.setPage(page);
		// 执行分页查询
		page.setList(commonMaterialListDao.selectfindList(commonMaterialList));
		return page;
	}

	/**
	 * @Title: 原辅料画面用品牌list
	 */
	/**
	 * @Title: getBrandList
	 * @return List<Brand>
	 */
	public List<Brand> getBrandList() {
		List<Brand> brandList =commonMaterialListDao.getBrandList();
		return brandList;
	}
	/**
	 * @Title: 原辅料画面用客户list
	 */
	/**
	 * @Title: getOgizationList
	 * @return List<OgnizationEntity>
	 */
	public List<OgnizationEntity> getOgizationList() {
		List<OgnizationEntity> ogizationList =commonMaterialListDao.getOgizationList();
		return ogizationList;
	}
}
